dnl $Id: configure.ac 536 2010-10-24 12:49:13Z eb771 $

AC_INIT([isbnlookup], [0.1], [vext01@gmail.com])

AC_PROG_CC
AC_CONFIG_HEADERS([config.h])

AC_SUBST([prefix])

AC_CHECK_HEADER([stdint.h], AC_DEFINE([HAVE_STDINT_H], [1], "stdint.h"), )

AC_CHECK_PROGS([XML2CONFIG], [xml2-config], [:])
if test "${XML2CONFIG}" = :; then
	AC_MSG_ERROR([No xml2-config found. Install libxml2 and dev stuff.])
fi

AC_CHECK_PROGS([INSTALL], [install], [:])
if test "${INSTALL}" = :; then
	AC_MSG_WARN([No 'install' program found.])
fi
AC_SUBST([INSTALL])

AC_CHECK_FUNC([asprintf], AC_DEFINE([HAVE_ASPRINTF], [1],
	[Does the system have asprintf]), )

if test "${prefix}" = "NONE"; then
	prefix=/usr/local
fi

BUILD_DIR=`pwd`
CPPFLAGS="${CPPFLAGS} -DDATAROOTDIR='\"${datarootdir}\"' \
	-DBUILD_DIR='\"${BUILD_DIR}\"'" 

AC_SUBST([PACKAGE_VERSION])
AC_CONFIG_FILES([src/Makefile Makefile])
AC_OUTPUT

echo "
===================================================================
How rare! That actually worked! Now run:
make		- to build.
make install	- to install into --prefix (NOT YET IMPLEMENTED).
===================================================================
"
